package com.huanletao.quartz.schedule;

import com.huanletao.quartz.entity.JobDetails;
import org.quartz.SchedulerException;

/**
 * description: QuartzSchedule <br>
 * date: 2022/7/3 11:18 <br>
 * author: 踏雪无痕 <br>
 * version: 1.0 <br>
 */
public interface QuartzSchedule {

    /**
     * 添加定时任务；
     */
    void addQuartzJob(JobDetails jobDetails) throws SchedulerException;

    /**
     * 移除定时任务；
     */
    void removeQuartzJob(JobDetails jobDetails) throws SchedulerException;

    /**
     * 触发一次；
     */
    void triggerJob(JobDetails jobDetails)throws SchedulerException;

    /**
     * 启动所有定时任务；
     */
    void startJobs()throws SchedulerException;

    /**
     * 关闭定时任务；
     */
    void shutdownJobs()throws SchedulerException;

    /**
     * 暂停任务
     */
    void pauseJob(JobDetails jobDetails)throws SchedulerException;

    /**
     * 恢复任务；
     */
    void resumeJob(JobDetails jobDetails)throws SchedulerException;
}
